<?php


namespace App\Http\Requests;


class BannerRequest extends Request
{
    public function rules()
    {
        switch($this->method())
        {
            // CREATE
            case 'POST':
            {
                return [
                    'image'=> 'required'
                ];
            }
            // UPDATE
            case 'PUT':
            case 'PATCH':
            {
                return [
                    // UPDATE ROLES
                ];
            }
            case 'GET':
            case 'DELETE':
            default:
            {
                return [];
            }
        }

    }

    public function messages()
    {
        return[
           'image.required'=> '图片必须上传'
        ];
    }

}
